<!DOCTYPE HTML>
<html class="minimal">
<title>Canvas test: 2d.pattern.paint.repeat.coord3</title>
<!--[if IE]><script src="../excanvas/excanvas.js"></script><![endif]-->
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="minimal.2d.pattern.paint.repeat.coord2.html" title="2d.pattern.paint.repeat.coord2">
<link rel="next" href="minimal.2d.pattern.paint.repeatx.basic.html" title="2d.pattern.paint.repeatx.basic">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<!-- TODO: handle "script did not run" case -->
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {

var img = document.getElementById('rgrg-256x256.png');
var pattern = ctx.createPattern(img, 'repeat');
ctx.fillStyle = pattern;
ctx.fillRect(0, 0, 100, 50);

ctx.translate(-128, -78);
ctx.fillRect(128, 78, 100, 50);

_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");


});
</script>
<img src="../images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource">

